#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int arr1[3] = { 0 };
	int arr2[3] = { 0 };

	for (int i = 0; i < 3; i++)
	{
		scanf("%d", &arr1[i]);
	}
	for (int i = 0; i < 3; i++)
	{
			scanf("%d", &arr2[i]);
	}

	
	int temp;
	for (int i = 0; i < 3; i++)
	{
		temp = arr1[i];
		arr1[i] = arr2[i];
		arr2[i] = temp;
	}
	for (int i = 0; i < 3; i++) {
		printf("%d ", arr1[i]);
	}
	printf("\n");
	
	for (int i = 0; i < 3; i++) {
		printf("%d ", arr2[i]);
	}
	
	return 0;

}